package main

import (
	"fmt"
	"local/service_manager"
	"local/services/demo"
	"local/services/demo2"
	"local/services/demo3"
	"local/services/demo4"
)

var serviceManager *service_manager.ServiceManager = service_manager.GetServiceManager()

func registerServices() {

	// 注册示例服务
	demoService := demo.NewService() // 恢复端口参数
	if err := serviceManager.RegisterService(demoService); err != nil {
		fmt.Println("注册demo服务失败:", err)
		return
	}

	// 注册demo2服务
	demo2Service := demo2.NewService() // 恢复端口参数
	if err := serviceManager.RegisterService(demo2Service); err != nil {
		fmt.Println("注册demo2服务失败:", err)
		return
	}

	// 注册demo3定时任务服务
	demo3Service := demo3.NewScheduleService()
	if err := serviceManager.RegisterService(demo3Service); err != nil {
		fmt.Println("注册demo3服务失败:", err)
		return
	}

	// 注册demo4消息处理服务
	demo4Service := demo4.NewMessageService()
	if err := serviceManager.RegisterService(demo4Service); err != nil {
		fmt.Println("注册demo4服务失败:", err)
		return
	}
}
